﻿<!--
(c) Copyright Fernando Cerqueira.
This source is subject to the Microsoft Public License (Ms-PL).
Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
All other rights reserved.
-->

<UserControl x:Class="WindowsPhoneCommands.ToolWindows.PhoneTranslateResx"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:res="clr-namespace:WindowsPhoneCommands"
             mc:Ignorable="d" 
             x:Name="TranslateResxControl"
             d:DesignHeight="800" d:DesignWidth="800" SizeChanged="TranslateResxControlSizeChanged" Unloaded="TranslateResxControlUnloaded">
    <Grid Margin="10" x:Name="GrdMain">
        <Grid.RowDefinitions>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
        </StackPanel>
        <ScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" UseLayoutRounding="True" Margin="0">
            <StackPanel>
                <GroupBox  Margin="0,10,10,10" Padding="5,0">
                    <GroupBox.Header>
                        <TextBlock Text="{Binding Source={x:Static res:Resources.XProject}}" FontWeight="Bold"/>
                    </GroupBox.Header>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Column="0" Margin="0,5,0,0">
                            <TextBlock Text="{Binding Source={x:Static res:Resources.XTitNeutralLng}}" />
                            <ComboBox x:Name="CboPrjLng" HorizontalAlignment="Left" MinWidth="300" LostFocus="CboPrjLngLostFocus" Margin="0,3,10,0" SelectionChanged="CboPrjLngSelectionChanged" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Grid.Column="1" Margin="0,5,0,0">
                            <StackPanel>
                                <TextBlock Text="{Binding Source={x:Static res:Resources.XSource}}"/>
                                <ComboBox x:Name="CboFilesResx" HorizontalAlignment="Left"  MinWidth="300" SelectionChanged="CboFilesResxSelectionChanged" LostFocus="CboFilesResxLostFocus" Margin="0,3,10,0" />
                            </StackPanel>
                            <Button Content="{Binding Source={x:Static res:Resources.XTargetFolder}}" Padding="3" VerticalAlignment="Bottom" Visibility="Visible" Name="BntTargetFolder" Click="BntTargetFolderClick" />
                        </StackPanel>
                        <CheckBox Grid.Row="1" Grid.ColumnSpan="2" Content="{Binding Source={x:Static res:Resources.XSynckeys}}" IsChecked="True" Name="ChkSync" VerticalAlignment="Center" Margin="0,5" IsEnabled="False" Visibility="Visible" />
                    </Grid>
                </GroupBox>
                <Grid x:Name="GrdCmd" MinWidth="610" HorizontalAlignment="Stretch">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                        <Button Content="{Binding Source={x:Static res:Resources.XNewTarget}}" Padding="3" Name="BntNewTarget" IsEnabled="False" Click="BntNewTargetClick" />
                        <Button Content="{Binding Source={x:Static res:Resources.XSaveTarget}}" Margin="10,0,0,0" Padding="3" Name="BntSave" IsEnabled="False" Click="BntSaveClick" />
                        <TextBlock x:Name="QtdOrph" Text="0" VerticalAlignment="Center" Margin="10,0,0,0" FontWeight="Bold"/>
                        <TextBlock x:Name="titkeyorph" Text="{Binding Source={x:Static res:Resources.XKeyOrph}}" VerticalAlignment="Center" Margin="3,0,0,0" FontWeight="Bold" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
                        <Image x:Name="Engine" Margin="0,0,5,0" Source="/WindowsPhoneCommands;component/Resources/bing_logo.png" Height="20" />
                        <Image x:Name="ChangeEngine" Margin="0,0,5,0" Source="/WindowsPhoneCommands;component/Resources/rotate.png" Height="20" MouseEnter="ChangeEngineMouseEnter" MouseLeave="ChangeEngineMouseLeave" MouseLeftButtonUp="ChangeEngineMouseLeftButtonUp" />
                        <Button Padding="3" Name="BntTran" IsEnabled="False" Click="BntTranClick" VerticalContentAlignment="Center">
                            <Button.Content>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock x:Name="TextRunTranslation" Text="{Binding Source={x:Static res:Resources.XRunTranslation}}"/>
                                </StackPanel>
                            </Button.Content>
                        </Button>
                        <TextBlock x:Name="QtdTotrans" Text="0" VerticalAlignment="Center" Margin="5,0,0,0" FontWeight="Bold" />
                        <TextBlock Text="{Binding Source={x:Static res:Resources.XKeyTranslated}}" VerticalAlignment="Center" Margin="3,0,0,0" FontWeight="Bold" />
                        <ProgressBar x:Name="PrgbarTrans" Width="150" Margin="5,0,0,0" Height="15"></ProgressBar>
                    </StackPanel>
                </Grid>
                <Grid>
                    <DataGrid AutoGenerateColumns="False" CommandManager.PreviewExecuted="PreviewCommandHandler"  GridLinesVisibility="Vertical"  Name="DGResx" SelectionMode="Single" Height="400" Margin="0,5,10,10"  MinWidth="610" Width="610" AlternationCount="2" AlternatingRowBackground="#FFD4D4D4" LoadingRow="DgResxLoadingRow" BeginningEdit="DgResxBeginningEdit" CurrentCellChanged="DgResxCurrentCellChanged" HorizontalAlignment="Stretch" CellEditEnding="DgResxCellEditEnding" PreparingCellForEdit="DgResxPreparingCellForEdit" MouseMove="DgResxMouseMove"  InitializingNewItem="DgResxInitializingNewItem" SelectionUnit="FullRow" PreviewMouseRightButtonUp="DgResxPreviewMouseRightButtonUp" IsSynchronizedWithCurrentItem="True" />
                    <TextBlock x:Name="Waitresx" Text="{Binding Source={x:Static res:Resources.WaitLoadingResx}}" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" />
                </Grid>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</UserControl>
